<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	pageContext.setAttribute("basePath",request.getContextPath());
%>
		<link href="static/css/message.css" rel="stylesheet"/>
		<div class="row border-bottom">
            <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header">
                    <a class="navbar-minimalize minimalize-styl-2" style="color:#FFF;" href="#" title="收起菜单">
                    	<i class="fa fa-bars"></i>
                    </a>
                </div>
                <ul class="nav navbar-top-links navbar-right welcome-message">
				    <li><a title="全屏显示" href="javascript:void(0)" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏显示</a></li>
                    <li class="dropdown user-menu">
						<a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown">
							<i class="preAdvise"><img src="${basePath}${user.head}" class="user-image"></i>
							<span class="hidden-xs">${user.name}</span>
						</a>
						<ul class="dropdown-menu">
							<li class="mt5">
								<a href="system/profile.jsp" class="menuItem">
								<i class="fa fa-user" data-id="${user.userId}"></i> 个人中心</a>
							</li>
							<li class="mt5">
								<a href="advise/myAdvise.do?adviseReceviser=${user.userId}&&adviseSender=${user.userId}" class="menuItem">
									<i class="fa fa-bell" data-id="${user.userId }"></i> 我的消息</a>
									
							</li>
							<li class="divider"></li>
							<li>
								<a href="login.jsp">
									<i class="fa fa-sign-out" data-id="${user.userId }"></i> 退出登录
								</a>
							</li>
						</ul>
					</li>
                </ul>
            </nav>
        </div>
<script src="static/js/jquery.min.js"></script>
<script src="static/ajax/libs/validate/jquery.validate.min.js"></script>
<script src="static/ajax/libs/validate/messages_zh.min.js"></script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/ajax/libs/layer/layer.min.js"></script>
<script src="static/ajax/libs/blockUI/jquery.blockUI.js"></script>
<script src="static/ruoyi/js/ry-ui.js"></script>
        <script>
        $(function(){
        	getUnreadAdvise();
        });
        
        function getUnreadAdvise(){
        	let data="${user.userId}";
        	$.ajax({
    			url : "${basePath}/advise/getUnreadAdvise.do?adviseReceviser="+data,
    			type : "POST",
    			dataType:"json",
    			success : function(response) {
    				if(response.AdviseUnreadListSize>0){
    					$(".preAdvise").append('<i class="advise-point"></i>');//小红点
    					$(".fa-bell").append('<div id="adviseCount" class="nav-counter nav-counter-blue">'+response.AdviseUnreadListSize+'</div>');//消息条数
    				}
    				
    			}
        	});
        }
        
        </script>